import request from '@/utils/request'

// 创建风险数据
export function createRiskInfo(data) {
  return request({
    url: '/biz/riskInfo/create',
    method: 'post',
    data: data
  })
}

// 更新风险数据
export function updateRiskInfo(data) {
  return request({
    url: '/biz/riskInfo/update',
    method: 'put',
    data: data
  })
}

// 删除风险数据
export function deleteRiskInfo(id) {
  return request({
    url: '/biz/riskInfo/delete?id=' + id,
    method: 'delete'
  })
}

// 获得风险数据
export function getRiskInfo(id) {
  return request({
    url: '/biz/riskInfo/get?id=' + id,
    method: 'get'
  })
}

// 获得风险数据分页
// export function getRiskInfoPage(query) {
//   return request({
//     url: '/biz/riskInfo/page',
//     method: 'get',
//     params: query
//   })
// }
export function getRiskInfoPage(query) {
  return request({
    url: '/biz/riskInfo/getRiskInfoPage',
    method: 'get',
    params: query
  })
}

// 导出风险数据 Excel
export function exportRiskInfoExcel(query) {
  return request({
    url: '/biz/riskInfo/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

//下载模板
export function downRiskTemplate(){
  return request({
    url: '/biz/riskInfo/downRiskTemplate',
    method: 'post',
    responseType: 'blob'
  })
}


//风险管控列表导出
export function exportRiskInfoExcel2(query) {
  return request({
    url: '/biz/riskInfo/exportRiskInfoExcel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
